package org.budo.dubbo.protocol.http.aop.permission.user;

import java.io.Serializable;

import org.budo.dubbo.protocol.http.exception.filter.ProviderSideNoLogException;

import lombok.Getter;
import lombok.Setter;

/**
 * @author lmw
 */
@Getter
@Setter
public class UserPermissionCheckException extends RuntimeException implements ProviderSideNoLogException {
    private static final long serialVersionUID = 3743083505347330453L;

    private Serializable userId;

    private String permissionName;

    public UserPermissionCheckException() {}

    public UserPermissionCheckException(Serializable userId, String permissionName) {
        this.userId = userId;

        this.permissionName = permissionName;
    }

    public String getMessage() {
        return "userPermissionCheck failed, userId=" + this.getUserId() + ", permissionName=" + this.getPermissionName();
    }
}
